package cn.tedu.oa_system.mapper;

import cn.tedu.oa_system.pojo.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author MW
 * @Description 系统菜单mapper
 * @CreateDate 2023/3/5 22:28
 * @Entity:
 */
@Repository
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    /**
     * 根据角色id查询所有父菜单
     */
    List<SysMenu> getParentMenuListByRoleId(Long roleId);

    /**
     * 根据角色id查询所有子菜单菜单
     */
    List<SysMenu> getSonMenuListByRoleId(Long roleId);

    /**
     * 根据id菜单上移
     */
    int up(Long menuId);

    /**
     * 根据id菜单下移
     */
    int down(Long menuId);
}
